package team.scau.laboratory_repair.web.mobile.registrant;

import io.swagger.annotations.ApiOperation;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import team.scau.laboratory_repair.common.base.BaseController;
import team.scau.laboratory_repair.service.AreaService;
import team.scau.laboratory_repair.service.RepairClassifyService;

@Controller
@CommonsLog
@RequestMapping("/mobile/registrant")
public class RegistrantController extends BaseController {

    @Autowired
    private AreaService areaService;
    @Autowired
    private RepairClassifyService repairClassifyService;
    @GetMapping("/homepage")
    @ApiOperation(value="返回微信端员工系统主界面", notes="")
    public String registrantHomePage(Model model) {
        model.addAttribute("openid", getOpenId());
        model.addAttribute("areas", areaService.findAll());
        model.addAttribute("classifies", repairClassifyService.findAll());
        return "/mobile/registrant/HomePage";
    }

    @GetMapping("/submitsuccess")
    @ApiOperation(value="返回微信端报修人提交记录成功界面", notes="")
    public String submitSuccess(Model model) {
        return "/mobile/registrant/SubmitSuccess";
    }
}
